{extend name="public:index"/}
{block name="title"}{:sysconf('title')}{/block}
{block name="content"}
	<section class="dingdanbox">
		<div class="top">
			<p class="p1"><a href="javascript:history.back(-1)"></a></p>
			<p class="p2">订单详情</p>
			<p class="p3"></p>
		</div>
		<div style="height:2rem;"></div>
		<div class="wanc">
			<img src="__INDEX__/images/ywc.png" alt="">
			{switch name="$order['status']"}
			{case value="0"}待付款{/case}
			{case value="1"}待发货{/case}
			{case value="2"}确认收货{/case}
			{case value="5"}交易完成{/case}
			{/switch}
		</div>
		<div class="ddbox1">
			<p class="p1"></p>
			<p class="p2"><b>{$order['name']}  {$order['mobile']}</b>
			<span>{$order['address']}</span></p>
		</div>
		<div class="shopmain">
			<ul class="shopul">
				{foreach name="order.goods" item="vo"}
				<li>
					<div class="center"><a href="{:url('Goods/show',['id'=>$vo['goods_id']])}"><img src="{$vo['goods_img_url']}" alt=""></a></div>
					<div class="right">
						<b><a href="{:url('Goods/show',['id'=>$vo['goods_id']])}">{$vo['goods_title']}</a></b>
						<p class="p1"><i>￥{$vo['goods_sell_price']}</i><em>X{$vo['goods_count']}</em></p>
					</div>
				</li>
				<li>
				{/foreach}
			</ul>
			<div class="orsh">
				<div class="orli">
					<p>订单编号：{$order['order_no']}</p>
					<p>下单时间：{$order['add_time']}</p>
				</div>
				<!--<div class="orli">-->
					<!--<p>支付方式：微信支付</p>-->
				<!--</div>-->
			</div>
		    <div class="xuanbox3">
				<div class="xuan"><p class="p1">商品总额</p><p class="p2">￥{$order['sum']}</p></div>
				<div class="xuan"><p class="p1">+运费</p><p class="p2">￥{$order['cost']}</p><p class="p3"></p></div>
				<div class="xuan"><p class="p1">优惠金额</p><p class="p2">￥{$order['coupon_money']}</p><p class="p3"></p></div>
				<div class="xuan xuan1"><p class="p3">实付款：<em>￥{$order['sum'] + $order['cost']}</em></p></div>
		    </div>
		</div>
		<div style="height:3rem;"></div>
		<div class="shouh">
			{switch name="$order['status']"}
			{case value="0"}<a href="{:url('Pay/index')}?orderNo={$order['order_no']}">去支付</a>{/case}
			{case value="1"}待发货{/case}
			{case value="2"}<a href="javascript:;" class="qrsh" data-id="{$order['id']}">确认收货</a>{/case}
			{case value="5"}<a href="{:url('Index/index')}">再次购买</a>{/case}
			{/switch}
		</div>
	</section>
<script>
    $(".qrsh").click(function () {
        var orderId = $(this).data('id');
        $.ajax({
            url: "{:url('Order/confirm')}",
            type: "POST",
            data: {'orderId':orderId},
            dataType: "JSON",
            success: function(data) {
                if (data.code == 0) {
                    layer.msg(data.msg,{'icon':6,time:1000},function () {
                        window.location.reload();
                    });
                } else {
                    layer.msg(data.msg,{'icon':5});
                }
            },
            error: function(){
                layer.msg("网络延迟，发送失败",{icon:5});
            }
        });
    });
</script>
{/block}